<!--
 * @Author: your name
 * @Date: 2021-08-03 13:36:05
 * @LastEditTime: 2021-08-12 13:26:42
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \getHome (2)\src\components\discounts\amend.vue
-->
<!--项目信息管理-->
<template>
  <div>
    <div class="herdertop">
      <img src="../../assets/top.png" alt="" class="topImg" />
      <el-breadcrumb separator="/">
        <el-breadcrumb-item>项目信息管理</el-breadcrumb-item>
        <el-breadcrumb-item>房间信息</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="center" style="padding-top: 0;">
      <div class="hander">房间信息</div>
      <div class="entirety">
        <div class="search">
          <!-- 活动名称搜索信息 -->

          <div class="demo-input-suffix">
            房间名称

            <el-input
              v-model="houseName"
              placeholder="房间名称查询"
              style="width:150px;"
            ></el-input>
          </div>

          <div class="demo-input-suffix">
            业主姓名

            <el-input
              v-model="ownerName"
              placeholder="业主姓名查询"
              style="width:150px;"
            ></el-input>
          </div>

          <!--  账号状态搜索信息 -->
          <div class="demo-input-suffix" style="margin-right:35px">
            <el-button
              style="background-color:#fd804c;color: #fff;"
              @click.native.prevent="isSelect"
              >查询</el-button
            >
            <el-button type="warning" @click.native.prevent="isEmpty"
              >清空</el-button
            >
          </div>
        </div>
      </div>
      <!--  员工列表栏位-->

      <div
        class="entirety"
        v-loading="isLoading"
        element-loading-text="数据加载中"
        element-loading-spinner="el-icon-loading"
        element-loading-custom-class="loading_color"
      >
        <el-table
          ref="multipleTable"
          :data="tableData"
          tooltip-effect="dark"
          style="width: 100%"
        >
          <el-table-column prop="houseCode" label="房间ID">
            <template slot-scope="scope">
              <div>
                {{ scope.row.houseCode }}
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="houseName" label="房间名称">
            <template slot-scope="scope">
              <div>
                {{ scope.row.houseName }}
              </div>
            </template>
          </el-table-column>
          <!-- <el-table-column prop="houseName" label="房间类型">
            <template slot-scope="scope">
              <div>
                {{ scope.row.houseName }}
              </div>
            </template>
          </el-table-column> -->
          <el-table-column prop="ownerName" label="业主姓名（手机号）">
            <template slot-scope="scope">
              <div>{{ scope.row.ownerName }}({{ scope.row.ownerPhone }})</div>
            </template>
          </el-table-column>
        </el-table>
        <!-- <div class="block">
          <div class="left"></div>
          <div class="right">
            <el-pagination
              layout="total, sizes, prev, pager, next, jumper"
              class="page"
              @size-change="sizeChangeHandle"
              @current-change="currentChangeHandle"
              :current-page="pageIndex"
              :page-size="pageSize"
              :total="total"
            >
            </el-pagination>
          </div>
        </div> -->
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // pageIndex: 1,
      // pageSize: 20,
      // total: 0,
      isLoading: false,

      tableData: [],
      houseName: "",
      ownerName: "",
      communityCode: ""
    };
  },
  activated() {
    this.communityCode = this.$route.query.communityCode || "";

    this.DetailByPage();
  },

  methods: {
    isSelect() {
      this.DetailByPage();
    },

    isEmpty() {
      (this.ownerName = ""), (this.houseName = ""), this.DetailByPage();
    },

    //分页获取优惠券模板列表接口调用
    DetailByPage() {
      this.isLoading = true;

      this.$http({
        url: `/pmcadmin/communityInfoManage/getHouseInfo`,
        method: "GET",
        params: {
          houseName: this.houseName,
          communityCode: this.communityCode,

          ownerName: this.ownerName
        }
      }).then(res => {
        this.isLoading = false;

        this.tableData = res.data;

        // [
        //   {
        //     houseCode: "112",
        //     houseName: "呵呵呵",
        //     ownerName: "刘新",
        //     ownerPhone: "13789679950"
        //   },
        //   {
        //     houseCode: "190",
        //     houseName: "王呵呵",
        //     ownerName: "王新",
        //     ownerPhone: "18789679950"
        //   }
        // ];
        // this.total = parseInt(res.data.total);
      });
    }

    // // 每页数
    // sizeChangeHandle(val) {
    //   this.pageSize = val;
    //   this.pageIndex = 1;
    //   this.DetailByPage();
    // },
    // // 当前页
    // currentChangeHandle(val) {
    //   this.pageIndex = val;
    //   this.DetailByPage();
    // }
  }
};
</script>
<style scoped lang="scss">
.block {
  width: 100%;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  padding: 0 10px 0 10px;
}
.left {
  font-size: 15px;
}
.hander {
  width: 100%;
  height: 50px;
  line-height: 50px;
  font-size: 20px;
  font-weight: 900;
}
.herdertop {
  height: 8vh;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
}
.topImg {
  margin-right: 20px;
}
.news {
  margin-left: 16%;
}
/deep/ .el-loading-spinner i {
  color: #fc9e76;
}
/deep/ .el-loading-spinner .el-loading-text {
  color: #fc9e76;
  margin: 3px 0;
  font-size: 14px;
}
.entirety {
  width: 95%;
  margin: 10px;
  border: 7px solid #fafafa;
  border-radius: 10px;
  .basic {
    font-size: 18px;
    font-weight: 900;
    margin-top: 2%;
    margin-bottom: 1%;

    margin-left: 1%;
  }
}

.overall {
  width: 100%;
  height: auto;
  display: flex;

  justify-content: space-between;
  margin-top: 3%;
  .left {
    width: 20%;
    height: auto;
  }
  .right {
    width: 80%;
    height: auto;
  }
}
.demo-input-suffix {
  margin-left: 2%;
}
.select {
  width: 65%;
  height: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .dialog-footer,
  .choice {
    margin-left: 2%;
  }
}
.userSearch {
  display: flex;
  /deep/ .el-input__inner {
    box-sizing: border-box;
    height: 40px;
    border-radius: 0;
    width: 132px;
    border: 1px solid #dcdfe6;
  }
  /deep/ .el-icon-arrow-up:before {
    position: relative;
    top: -4px;
  }
  /deep/ .el-button {
    height: 40px;
    border-radius: 0;
    background-color: #fff;
    border: 1px solid #dcdfe6;
    border-left: none;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    position: relative;
    .el-icon-search {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }
  }
  /deep/ .el-input--suffix .el-input__inner {
    border-right: none;
  }
  /deep/ .el-input--suffix .el-input__inner {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
  }
}
.selects {
  width: 55%;
  height: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .dialog-footer,
  .choice {
    margin-left: 2%;
  }
}

/deep/ .but {
  background: #fd7097;
  color: #fff;
  margin-bottom: 1%;
}
</style>
